{layout name="layout/header" /}
<link href="root/css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="root/css/plugins/summernote/summernote.css" rel="stylesheet">
<link href="root/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
<link href="root/js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">

<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>系统设置</h5>
                    <div class="ibox-tools">
                        <button type="button" class="btn btn-primary btn-sm refresh">刷新</button>

                    </div>
                </div>
                <div class="ibox-content">
                    <form method="post" class="form-horizontal" id="form" action="{:url('index')}">
                        <!--基本资料-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">单本价格(元)</label>
                            <div class="col-sm-10">
                                <input type="text" name="price" class="form-control" value="{$data.price/100}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">小程序使用说明</label>
                            <div class="col-sm-10">
                                <textarea name="use_text"  style="display: none;">{$data.use_text}</textarea>
                                <div class="ibox-content no-padding" >
                                    <div class="summernote" >
                                        {$data.use_text}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">H5使用说明</label>
                            <div class="col-sm-10">
                                <textarea name="buy_text"  style="display: none;">{$data.buy_text}</textarea>
                                <div class="ibox-content no-padding" >
                                    <div class="summernote" >
                                        {$data.buy_text}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">保存</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>

<!-- iCheck -->
<script src="root/js/plugins/iCheck/icheck.min.js"></script>
<!--layer-->
<script src="root/js/plugins/layer/layer.min.js"></script>

<script src="root/js/plugins/validate/jquery.validate.min.js"></script>
<script src="root/js/plugins/validate/messages_zh.min.js"></script>
<script src="root/js/plugins/fancybox/jquery.fancybox.js"></script>
<script src="root/js/plugins/summernote/summernote.min.js"></script>
<script src="root/js/plugins/summernote/summernote-zh-CN.js"></script>
<script>
    $(document).ready(function () {
        checks();
        // $('.fancybox').fancybox({
        //     openEffect: 'none',
        //     closeEffect: 'none'
        // });

    });

</script>
<script>
    $(function () {
        $("#form").validate({
            rules: {
                price: {
                    required:true,
                    number:true,
                },


            }
        })
    })
</script>
<script type="text/javascript">
    //summernote编辑器图片上传

    $('.summernote').summernote({
        lang:'zh-CN',
        // 重写图片上传
        onImageUpload: function(files, editor, $editable) {
            sendFile(files[0],editor,$editable);
        },
        onblur:function () {
            var content = $(this).code();
            $(this).parent().parent().prev().val(content);
        }
    });



</script>